package com.cloud.shiro.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaoyangfu - 2020/7/23 10:41
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping
    public String get() {
        return "get...";
    }

    @RequiresRoles(value = {"admin", "test"}, logical = Logical.OR)
    @RequiresPermissions(value = {"user:list", "user:query"}, logical = Logical.AND)
    public String query() {
        return "query...";
    }

    @GetMapping("/find")
    public String find() {
        return "find...";
    }
}
